#include <iostream>
#include <string>
#include <vector>
#include <functional>

void print(const std::string& str)
{
    std::cout<<str<<std::endl;
}

int main()
{
    print("nihao");
    using Func = std::function<void()>;
    std::vector<Func> vf;
    vf.push_back(std::bind(print,"Nihao"));
    vf.push_back(std::bind(print,"chilema"));
    vf.push_back(std::bind(print,"ok"));
    for(auto& f:vf)
    {
        //提前绑定，使用时直接调用即可
        f();
    }
    return 0;
}

